package cn.whitecao.sb.test.controller;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class DingDingRequest {

    /**
     * msgtype : text
     * text : {"content":"我就是我, 是不一样的烟火"}
     * msgId : XXXX
     * createAt : 1487561654123
     * conversationType : 2
     * conversationId : XXXX
     * conversationTitle : 钉钉群标题
     * senderId : XXXX
     * senderNick : 星星
     * senderCorpId : XXXX
     * senderStaffId : XXXX
     * chatbotUserId : XXXX
     * atUsers : [{"dingtalkId":"XXXX","staffId":"XXXX"}]
     */

    @JsonProperty("msgtype")
    private String msgtype;
    @JsonProperty("text")
    private TextDTO text;
    @JsonProperty("msgId")
    private String msgId;
    @JsonProperty("createAt")
    private Long createAt;
    @JsonProperty("conversationType")
    private String conversationType;
    @JsonProperty("conversationId")
    private String conversationId;
    @JsonProperty("conversationTitle")
    private String conversationTitle;
    @JsonProperty("senderId")
    private String senderId;
    @JsonProperty("senderNick")
    private String senderNick;
    @JsonProperty("senderCorpId")
    private String senderCorpId;
    @JsonProperty("senderStaffId")
    private String senderStaffId;
    @JsonProperty("chatbotUserId")
    private String chatbotUserId;
    @JsonProperty("atUsers")
    private List<AtUsersDTO> atUsers;

    @NoArgsConstructor
    @Data
    public static class TextDTO {
        /**
         * content : 我就是我, 是不一样的烟火
         */

        @JsonProperty("content")
        private String content;
    }

    @NoArgsConstructor
    @Data
    public static class AtUsersDTO {
        /**
         * dingtalkId : XXXX
         * staffId : XXXX
         */

        @JsonProperty("dingtalkId")
        private String dingtalkId;
        @JsonProperty("staffId")
        private String staffId;
    }
}
